package vip.liux.backend.application.service.product;

import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import vip.liux.contracts.shared.enums.product.CategoryLevel;
import vip.liux.contracts.shared.enums.product.CategoryType;
import vip.liux.contracts.shared.value.LevelModel;

import java.time.LocalDateTime;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
public class CategoryDto extends CreateCategoryDto implements LevelModel<CategoryDto> {
    private Long id;
    /**
     * 类目类型 0:实物类,1:虚拟类
     */
    private CategoryType type;

    /**
     * 类目级别 0:一级类目,1:二级类目,2:三级类目
     */
    private CategoryLevel level;

    /**
     * 类目编号
     */
    private String catNo;

    /**
     * 创建时间
     */
    @NotNull
    private LocalDateTime creationTime;

    /**
     * 最后修改者ID
     */
    private String lastModifierId;

    /**
     * 最后修改时间
     */
    private LocalDateTime lastModificationTime;

    /**
     * 父类目
     */
    private CategoryDto parent;

    private List<CategoryDto> children;

    @Override
    public List<CategoryDto> getChildren() {
        return children;
    }

    @Override
    public void setChildren(List<CategoryDto> children) {
        this.children = children;
    }
}
